﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter12.Code02.Code02
{
    public class Demo
    {
        public static void Begin()
        {

            {
                List<int> myCollection = new List<int>();
                myCollection.Add(1);
                myCollection.Add(2);
                int itemAtIndex2 = myCollection[1];
            }
            {
                Dictionary<string, int> things = new Dictionary<string, int>();
                things.Add("Green Things", 29);
                things.Add("Blue Things", 94);
                things.Add("Yellow", 34);
                things.Add("Red Things", 52);
                things.Add("Brown Things", 27);
                foreach (string key in things.Keys)
                {
                    Console.WriteLine(key);
                }
                foreach (int value in things.Values)
                {
                    Console.WriteLine(value);
                }
                foreach (KeyValuePair<string, int> thing in things)
                {
                    Console.WriteLine("{0} = {1}", thing.Key, thing.Value);
                }
                Console.ReadLine();
            }
            {
                Dictionary<string, int>  things = new Dictionary<string, int>(StringComparer.CurrentCultureIgnoreCase);
                things.Add("Green Things", 29);
                //things.Add("Green things", 94);
            }
        }
    }
}
